3.7.73 \(\int (a+b \sec (c+d x))^3 (a^2-b^2 \sec ^2(c+d x)) \, dx\) [673]

3.7.73.1 Optimal result
3.7.73.2 Mathematica [A] (verified)
3.7.73.3 Rubi [A] (verified)
3.7.73.4 Maple [A] (verified)
3.7.73.5 Fricas [A] (verification not implemented)
3.7.73.6 Sympy [F]
3.7.73.7 Maxima [A] (verification not implemented)
3.7.73.8 Giac [B] (verification not implemented)
3.7.73.9 Mupad [B] (verification not implemented)

3.7.73.1 Optimal result

Integrand size = 30, antiderivative size = 158 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=a^5 x+\frac {b \left (24 a^4-8 a^2 b^2-3 b^4\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a b^2 \left (5 a^2-4 b^2\right ) \tan (c+d x)}{2 d}+\frac {b^3 \left (2 a^2-3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}-\frac {a b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}-\frac {b^2 (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \]

output
a^5*x+1/8*b*(24*a^4-8*a^2*b^2-3*b^4)*arctanh(sin(d*x+c))/d+1/2*a*b^2*(5*a^ 
2-4*b^2)*tan(d*x+c)/d+1/8*b^3*(2*a^2-3*b^2)*sec(d*x+c)*tan(d*x+c)/d-1/4*a* 
b^2*(a+b*sec(d*x+c))^2*tan(d*x+c)/d-1/4*b^2*(a+b*sec(d*x+c))^3*tan(d*x+c)/ 
d
 
3.7.73.2 Mathematica [A] (verified)

Time = 1.88 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.19 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=-\frac {\left (-b^2+a^2 \cos ^2(c+d x)\right ) \sec ^3(c+d x) \left (-16 a^5 d x \cos ^3(c+d x)+2 b \left (-24 a^4+8 a^2 b^2+3 b^4\right ) \text {arctanh}(\sin (c+d x)) \cos ^3(c+d x)-16 a b^2 \left (2 a^2-3 b^2\right ) \cos ^2(c+d x) \sin (c+d x)+b^3 \left (16 a b \sin ^3(c+d x)+\left (8 a^2+3 b^2\right ) \sin (2 (c+d x))+4 b^2 \tan (c+d x)\right )\right )}{8 d \left (a^2-2 b^2+a^2 \cos (2 (c+d x))\right )} \]

input
Integrate[(a + b*Sec[c + d*x])^3*(a^2 - b^2*Sec[c + d*x]^2),x]
 
output
-1/8*((-b^2 + a^2*Cos[c + d*x]^2)*Sec[c + d*x]^3*(-16*a^5*d*x*Cos[c + d*x] 
^3 + 2*b*(-24*a^4 + 8*a^2*b^2 + 3*b^4)*ArcTanh[Sin[c + d*x]]*Cos[c + d*x]^ 
3 - 16*a*b^2*(2*a^2 - 3*b^2)*Cos[c + d*x]^2*Sin[c + d*x] + b^3*(16*a*b*Sin 
[c + d*x]^3 + (8*a^2 + 3*b^2)*Sin[2*(c + d*x)] + 4*b^2*Tan[c + d*x])))/(d* 
(a^2 - 2*b^2 + a^2*Cos[2*(c + d*x)]))
 
3.7.73.3 Rubi [A] (verified)

Time = 0.75 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.03, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.367, Rules used = {3042, 4530, 25, 3042, 4406, 3042, 4544, 27, 3042, 4536, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^3 \left (a^2-b^2 \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\)

\(\Big \downarrow \) 4530

\(\displaystyle -\int -\left ((a-b \sec (c+d x)) (a+b \sec (c+d x))^4\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int (a-b \sec (c+d x)) (a+b \sec (c+d x))^4dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a-b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^4dx\)

\(\Big \downarrow \) 4406

\(\displaystyle \frac {1}{4} \int (a+b \sec (c+d x))^2 \left (4 a^3-3 b^2 \sec ^2(c+d x) a+b \left (4 a^2-3 b^2\right ) \sec (c+d x)\right )dx-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (4 a^3-3 b^2 \csc \left (c+d x+\frac {\pi }{2}\right )^2 a+b \left (4 a^2-3 b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 4544

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int 3 (a+b \sec (c+d x)) \left (4 a^4+b \left (8 a^2-5 b^2\right ) \sec (c+d x) a+b^2 \left (2 a^2-3 b^2\right ) \sec ^2(c+d x)\right )dx-\frac {a b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{4} \left (\int (a+b \sec (c+d x)) \left (4 a^4+b \left (8 a^2-5 b^2\right ) \sec (c+d x) a+b^2 \left (2 a^2-3 b^2\right ) \sec ^2(c+d x)\right )dx-\frac {a b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \left (\int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (4 a^4+b \left (8 a^2-5 b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right ) a+b^2 \left (2 a^2-3 b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )dx-\frac {a b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 4536

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \int \left (8 a^5+4 b^2 \left (5 a^2-4 b^2\right ) \sec ^2(c+d x) a+b \left (24 a^4-8 b^2 a^2-3 b^4\right ) \sec (c+d x)\right )dx+\frac {b^3 \left (2 a^2-3 b^2\right ) \tan (c+d x) \sec (c+d x)}{2 d}-\frac {a b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{4} \left (\frac {b^3 \left (2 a^2-3 b^2\right ) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {1}{2} \left (8 a^5 x+\frac {4 a b^2 \left (5 a^2-4 b^2\right ) \tan (c+d x)}{d}+\frac {b \left (24 a^4-8 a^2 b^2-3 b^4\right ) \text {arctanh}(\sin (c+d x))}{d}\right )-\frac {a b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}\)

input
Int[(a + b*Sec[c + d*x])^3*(a^2 - b^2*Sec[c + d*x]^2),x]
 
output
-1/4*(b^2*(a + b*Sec[c + d*x])^3*Tan[c + d*x])/d + ((b^3*(2*a^2 - 3*b^2)*S 
ec[c + d*x]*Tan[c + d*x])/(2*d) - (a*b^2*(a + b*Sec[c + d*x])^2*Tan[c + d* 
x])/d + (8*a^5*x + (b*(24*a^4 - 8*a^2*b^2 - 3*b^4)*ArcTanh[Sin[c + d*x]])/ 
d + (4*a*b^2*(5*a^2 - 4*b^2)*Tan[c + d*x])/d)/2)/4
 

3.7.73.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4406
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d 
_.) + (c_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m 
 - 1)/(f*m)), x] + Simp[1/m   Int[(a + b*Csc[e + f*x])^(m - 2)*Simp[a^2*c*m 
 + (b^2*d*(m - 1) + 2*a*b*c*m + a^2*d*m)*Csc[e + f*x] + b*(b*c*m + a*d*(2*m 
 - 1))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b* 
c - a*d, 0] && GtQ[m, 1] && NeQ[a^2 - b^2, 0] && IntegerQ[2*m]
 

rule 4530
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_. 
) + (a_))^(m_.), x_Symbol] :> Simp[C/b^2   Int[(a + b*Csc[e + f*x])^(m + 1) 
*Simp[-a + b*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && 
 EqQ[A*b^2 + a^2*C, 0]
 

rule 4536
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + 
 f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2   Int[Simp[2*A*a + (2*B*a + b*(2* 
A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a 
, b, e, f, A, B, C}, x]
 

rule 4544
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Simp[(-C)*Cot 
[e + f*x]*((a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(m + 1)   Int[( 
a + b*Csc[e + f*x])^(m - 1)*Simp[a*A*(m + 1) + ((A*b + a*B)*(m + 1) + b*C*m 
)*Csc[e + f*x] + (b*B*(m + 1) + a*C*m)*Csc[e + f*x]^2, x], x], x] /; FreeQ[ 
{a, b, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0] && IGtQ[2*m, 0]
 
3.7.73.4 Maple [A] (verified)

Time = 0.97 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.02

method result size
derivativedivides \(\frac {a^{5} \left (d x +c \right )+2 a^{3} b^{2} \tan \left (d x +c \right )+3 a^{4} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a^{2} b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a \,b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-b^{5} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(161\)
default \(\frac {a^{5} \left (d x +c \right )+2 a^{3} b^{2} \tan \left (d x +c \right )+3 a^{4} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a^{2} b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a \,b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-b^{5} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(161\)
parts \(a^{5} x -\frac {b^{5} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {3 a^{4} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {2 a^{3} b^{2} \tan \left (d x +c \right )}{d}-\frac {a^{2} b^{3} \tan \left (d x +c \right ) \sec \left (d x +c \right )}{d}-\frac {a^{2} b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) \(174\)
parallelrisch \(\frac {-48 \left (a^{4}-\frac {1}{3} a^{2} b^{2}-\frac {1}{8} b^{4}\right ) b \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+48 \left (a^{4}-\frac {1}{3} a^{2} b^{2}-\frac {1}{8} b^{4}\right ) b \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+16 a^{5} x d \cos \left (2 d x +2 c \right )+4 a^{5} x d \cos \left (4 d x +4 c \right )+16 \left (a^{3} b^{2}-2 a \,b^{4}\right ) \sin \left (2 d x +2 c \right )+\left (-8 a^{2} b^{3}-3 b^{5}\right ) \sin \left (3 d x +3 c \right )+8 \left (a^{3} b^{2}-a \,b^{4}\right ) \sin \left (4 d x +4 c \right )+\left (-8 a^{2} b^{3}-11 b^{5}\right ) \sin \left (d x +c \right )+12 a^{5} x d}{4 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) \(273\)
norman \(\frac {a^{5} x +a^{5} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}-4 a^{5} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+6 a^{5} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-4 a^{5} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\frac {b^{2} \left (16 a^{3}-8 a^{2} b -24 a \,b^{2}-5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {b^{2} \left (16 a^{3}+8 a^{2} b -24 a \,b^{2}+5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}-\frac {b^{2} \left (48 a^{3}-8 a^{2} b -40 a \,b^{2}+3 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {b^{2} \left (48 a^{3}+8 a^{2} b -40 a \,b^{2}-3 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4}}-\frac {b \left (24 a^{4}-8 a^{2} b^{2}-3 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {b \left (24 a^{4}-8 a^{2} b^{2}-3 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(331\)
risch \(a^{5} x +\frac {i b^{2} \left (8 a^{2} b \,{\mathrm e}^{7 i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{7 i \left (d x +c \right )}+16 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+8 a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}+11 b^{3} {\mathrm e}^{5 i \left (d x +c \right )}+48 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-48 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-8 a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}-11 b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+48 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-64 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-8 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}-3 b^{3} {\mathrm e}^{i \left (d x +c \right )}+16 a^{3}-16 a \,b^{2}\right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{4}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {3 b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{4}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {3 b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) \(362\)

input
int((a+b*sec(d*x+c))^3*(a^2-b^2*sec(d*x+c)^2),x,method=_RETURNVERBOSE)
 
output
1/d*(a^5*(d*x+c)+2*a^3*b^2*tan(d*x+c)+3*a^4*b*ln(sec(d*x+c)+tan(d*x+c))-2* 
a^2*b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+3*a*b^4* 
(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)-b^5*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c) 
)*tan(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x+c))))
 
3.7.73.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.15 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\frac {16 \, a^{5} d x \cos \left (d x + c\right )^{4} + {\left (24 \, a^{4} b - 8 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (24 \, a^{4} b - 8 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (8 \, a b^{4} \cos \left (d x + c\right ) + 2 \, b^{5} - 16 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{3} + {\left (8 \, a^{2} b^{3} + 3 \, b^{5}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \]

input
integrate((a+b*sec(d*x+c))^3*(a^2-b^2*sec(d*x+c)^2),x, algorithm="fricas")
 
output
1/16*(16*a^5*d*x*cos(d*x + c)^4 + (24*a^4*b - 8*a^2*b^3 - 3*b^5)*cos(d*x + 
 c)^4*log(sin(d*x + c) + 1) - (24*a^4*b - 8*a^2*b^3 - 3*b^5)*cos(d*x + c)^ 
4*log(-sin(d*x + c) + 1) - 2*(8*a*b^4*cos(d*x + c) + 2*b^5 - 16*(a^3*b^2 - 
 a*b^4)*cos(d*x + c)^3 + (8*a^2*b^3 + 3*b^5)*cos(d*x + c)^2)*sin(d*x + c)) 
/(d*cos(d*x + c)^4)
 
3.7.73.6 Sympy [F]

\[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\int \left (a - b \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{4}\, dx \]

input
integrate((a+b*sec(d*x+c))**3*(a**2-b**2*sec(d*x+c)**2),x)
 
output
Integral((a - b*sec(c + d*x))*(a + b*sec(c + d*x))**4, x)
 
3.7.73.7 Maxima [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.22 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\frac {16 \, {\left (d x + c\right )} a^{5} - 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a b^{4} + b^{5} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, a^{2} b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, a^{4} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 32 \, a^{3} b^{2} \tan \left (d x + c\right )}{16 \, d} \]

input
integrate((a+b*sec(d*x+c))^3*(a^2-b^2*sec(d*x+c)^2),x, algorithm="maxima")
 
output
1/16*(16*(d*x + c)*a^5 - 16*(tan(d*x + c)^3 + 3*tan(d*x + c))*a*b^4 + b^5* 
(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 
+ 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) + 8*a^2*b^3*(2*s 
in(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c 
) - 1)) + 48*a^4*b*log(sec(d*x + c) + tan(d*x + c)) + 32*a^3*b^2*tan(d*x + 
 c))/d
 
3.7.73.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 379 vs. \(2 (148) = 296\).

Time = 0.36 (sec) , antiderivative size = 379, normalized size of antiderivative = 2.40 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\frac {8 \, {\left (d x + c\right )} a^{5} + {\left (24 \, a^{4} b - 8 \, a^{2} b^{3} - 3 \, b^{5}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (24 \, a^{4} b - 8 \, a^{2} b^{3} - 3 \, b^{5}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (16 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 8 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 5 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 8 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 40 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 24 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{8 \, d} \]

input
integrate((a+b*sec(d*x+c))^3*(a^2-b^2*sec(d*x+c)^2),x, algorithm="giac")
 
output
1/8*(8*(d*x + c)*a^5 + (24*a^4*b - 8*a^2*b^3 - 3*b^5)*log(abs(tan(1/2*d*x 
+ 1/2*c) + 1)) - (24*a^4*b - 8*a^2*b^3 - 3*b^5)*log(abs(tan(1/2*d*x + 1/2* 
c) - 1)) - 2*(16*a^3*b^2*tan(1/2*d*x + 1/2*c)^7 + 8*a^2*b^3*tan(1/2*d*x + 
1/2*c)^7 - 24*a*b^4*tan(1/2*d*x + 1/2*c)^7 + 5*b^5*tan(1/2*d*x + 1/2*c)^7 
- 48*a^3*b^2*tan(1/2*d*x + 1/2*c)^5 - 8*a^2*b^3*tan(1/2*d*x + 1/2*c)^5 + 4 
0*a*b^4*tan(1/2*d*x + 1/2*c)^5 + 3*b^5*tan(1/2*d*x + 1/2*c)^5 + 48*a^3*b^2 
*tan(1/2*d*x + 1/2*c)^3 - 8*a^2*b^3*tan(1/2*d*x + 1/2*c)^3 - 40*a*b^4*tan( 
1/2*d*x + 1/2*c)^3 + 3*b^5*tan(1/2*d*x + 1/2*c)^3 - 16*a^3*b^2*tan(1/2*d*x 
 + 1/2*c) + 8*a^2*b^3*tan(1/2*d*x + 1/2*c) + 24*a*b^4*tan(1/2*d*x + 1/2*c) 
 + 5*b^5*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d
 
3.7.73.9 Mupad [B] (verification not implemented)

Time = 16.60 (sec) , antiderivative size = 274, normalized size of antiderivative = 1.73 \[ \int (a+b \sec (c+d x))^3 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\frac {2\,a^5\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {3\,b^5\,\sin \left (c+d\,x\right )}{8\,d\,{\cos \left (c+d\,x\right )}^2}-\frac {b^5\,\sin \left (c+d\,x\right )}{4\,d\,{\cos \left (c+d\,x\right )}^4}-\frac {2\,a\,b^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {a\,b^4\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^3}+\frac {2\,a^3\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {a^2\,b^3\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2}+\frac {b^5\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}}{4\,d}+\frac {a^2\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {a^4\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,6{}\mathrm {i}}{d} \]

input
int((a^2 - b^2/cos(c + d*x)^2)*(a + b/cos(c + d*x))^3,x)
 
output
(2*a^5*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^5*atan((sin(c/2 
 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*3i)/(4*d) - (3*b^5*sin(c + d*x))/(8*d* 
cos(c + d*x)^2) - (b^5*sin(c + d*x))/(4*d*cos(c + d*x)^4) + (a^2*b^3*atan( 
(sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*2i)/d - (a^4*b*atan((sin(c/2 + 
 (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*6i)/d - (2*a*b^4*sin(c + d*x))/(d*cos(c 
+ d*x)) - (a*b^4*sin(c + d*x))/(d*cos(c + d*x)^3) + (2*a^3*b^2*sin(c + d*x 
))/(d*cos(c + d*x)) - (a^2*b^3*sin(c + d*x))/(d*cos(c + d*x)^2)